import { Statistic } from 'element-ui'
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//后台管理页面
const AdminLogin = () => import('../views/admin/AdminLogin')
const MerchantRegist = () => import('../views/admin/MerchantRegist')
const AdminPage = () => import('../views/admin/AdminFramwork')
const MerchantManager = () => import('../views/admin/MerchantManager')
const AdminUserManager = () => import('../views/admin/UserManager')
const VolunteerManager = () => import('../views/admin/VolunteerManager')
const AdminProfile = () => import('../views/admin/AdminProfile')
const Dashboard = () => import('../views/community/Dashboard')
const MerProfile = () => import('../views/community/MerProfile')
const ForumManager = () => import('@/views/admin/ForumManager')
const ForumDetailManager = () => import('@/views/admin/ForumDetail')
const MerForumManager = () => import('@/views/community/MerForumManager')
const MerForumDetailManager = () => import('@/views/community/MerForumDetail')
const ServiceManager = () => import('@/views/community/ServiceManager')
const ServiceFeedback = () => import('@/views/community/ServiceFeedback')
const InfomationManager = () => import('@/views/community/InfomationManager')
const CommunityManager = () => import('@/views/admin/CommunityManager')
const SysLogManager = () => import('@/views/admin/SysLogManager')
const ServiceLogManager = () => import('@/views/admin/ServiceLogManager')
const ConfigManager = () => import('@/views/admin/ConfigManager')

const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [{
      path: "/comm/reg",
      name: "社区管理员注册页面",
      component: MerchantRegist
    },
    {
      path: "/admin/login",
      name: "管理员登录",
      component: AdminLogin
    },
    {
      path: '/admin',
      component: AdminPage,
      children: [
        {
          path: "usermgr",
          name: "用户管理",
          component: AdminUserManager
        }, {
          path: "volmgr",
          name: "志愿者管理",
          component: VolunteerManager
        }, {
          path: "manager/user",
          name: "社区管理员管理",
          component: MerchantManager
        }, {
          path: "community/list",
          name: "社区管理",
          component: CommunityManager
        }, {
          path: "profile",
          name: "个人信息",
          component: AdminProfile
        },{
          path: "service/list",
          name: "服务请求管理",
          component: ServiceManager
        },{
          path: "service/feedback",
          name: "服务请求管理",
          component: ServiceFeedback
        },{
          path: "merchant/dashboard",
          name: "社区管理员的统计面板",
          component: Dashboard
        },{
          path: "merchant/profile",
          name: "社区管理员的个人中心",
          component: MerProfile
        }, {
          path: "forum/list",
          name: "帖子管理",
          component: ForumManager
        }, {
          path: "forum/commentmgr",
          name: "评论管理",
          component: ForumDetailManager
        }, {
          path: "mer/forum/list",
          name: "社区管理员帖子列表",
          component: MerForumManager
        }, {
          path: "mer/forum/commentmgr",
          name: "社区管理员帖子详情",
          component: MerForumDetailManager
        }, {
          path: "info/list",
          name: "社区管理员资讯管理",
          component: InfomationManager
        }, {
          path: "log/list",
          name: "登录日志管理",
          component: SysLogManager
        }, {
          path: "log/service/list",
          name: "服务日志管理",
          component: ServiceLogManager
        },{
          path: "config/list",
          name: "系统参数管理",
          component: ConfigManager
        }
      ]
    },
  ]
});

export default router;